<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>后台管理</title>

<link href="static/css/bass.css" rel="stylesheet" type="text/css">
<script src="static/js/jquery.js" type="text/javascript"></script>

</head>

<body>
<div class="pageHeader">
	<h3><i class="fa fa-table"></i> 栏目管理</h3>
    <div class="fr">
    	<a href="javascript:history.go(-1);location.reload();" class="btn">返回</a>    
    </div>  
</div>


<div class="pageAction">
	<div class="fl">
    	<a href="?dopost=add" class="btn"><i class="fa fa-plus"></i> 添加</a>
        <a href="javascript:location.reload();" class="btn"><i class="fa fa-refresh"></i> 刷新</a> 
    </div>
</div>
<form action="" method="post"  class="listForm">



<div class="mainList">
<div class="batchControl" style="display:none;"> 
        批量操作：
        <button type="button" btnbatchupdate="batch_del" >批量删除</button>  

        |
    批量移动到：
        <select name="movetid" >
            <option value="0"  >---顶级栏目---</option>
    <?php foreach($typelist as $v ){
       
        echo  "<option value=\"{$v['tid']}\" > {$v['_prefix']}{$v['typename']}</option>".PHP_EOL;
    } ?>
        </select>
        <button type="button" btnbatchupdate="batch_move" >移动</button>




    </div>
    

<?php
//php程序如何输出当前页？？？
//var_dump($_SERVER);
//echo  $_SERVER['REQUEST_URI'];
?>
<input type='hidden' name="url" value="<?php echo  $_SERVER['REQUEST_URI'];?>"/>
<table class="list_table_A"  border="1" cellspacing="0" cellpadding="0">
  <tr>
    <th align="left" width="50">
    <input type="checkbox" cbGroupControl='A'/>tid
    </th>
    <th align="left">栏目名称</th>
    <th align="left">栏目类型</th>

  
    <th align="left" width="80">
        <input type="checkbox" cbGroupControl='B' />
        <button type="submit" btnbatchupdate="batch_display">显示</button>
    </th>
    <th align="left" width="50">
    <button type="submit" btnbatchupdate="batch_sort" >批量排序</button>
    </th>
    <th align="left" width="220">操作</th>
  </tr>
<?php foreach( $typelist as $v ):?>
  <tr>
    <td>
    <input type="checkbox" cbGroup='A' name="tid[<?php echo $v['tid']?>]" value="<?php echo $v['tid']?>"/>
    <?php echo $v['tid']?>

    </td>
    <td>
        <?php echo $v['_prefix']?>   <a href="#"><?php echo $v['typename']?></a>
    </td>
    <td>
        <?php 
        $arr = array();
        $arr[1] = '栏目列表';
        $arr[2] = '栏目封面';
        $arr[3] = '跳转地址';
        echo $arr[$v['type']];

        ?>

    </td>
    
    <td>

        <?php if($v['display'] == 1 ){
            echo '<span class="d_display_1"><input cbGroup="B" type="checkbox" name="display['.$v['tid'].']" value="1"  checked  /></span>';
        }else{
            echo '<span class="d_display_0"><input cbGroup="B" type="checkbox" name="display['.$v['tid'].']" value="1"    /></span>';
        }?>
        
        
        
    </td>
    <td><input type="text" name="sort[<?php echo $v['tid']?>]" class="input-mini" value="<?php echo $v['sort']?>"></td>
    <td>
        
    	<a href="?dopost=show&tid=<?php echo $v['tid'];?>" class="btn" title="预览" target="_blank"><i class="fa fa-search"></i></a>
        <a href="article.php?tid=<?php echo $v['tid'];?>" class="btn" title="管理文章"><i class="fa fa-sitemap"></i></a>
        <a href="?dopost=add&pid=<?php echo $v['tid']?>" class="btn" title="添加子栏目"><i class="fa fa-plus"></i> </a>
        <a href="?dopost=upt&tid=<?php echo $v['tid']?>" class="btn" title="修改"><i class="fa fa-edit"></i></a>
        <a href="?dopost=del&tid=<?php echo $v['tid']?>"  class="btn btn_del" title="删除"  ><i class="fa fa-trash"></i></a>    </td>
  </tr>
<?php endforeach;?>
</table>

</div>
<div class="pages">
	
</div>
</form>


<!-- 插件 -->
<script src="static/lib/My97DatePicker/WdatePicker.js"></script>

<script src="static/lib/validate/jquery.validate.js"></script>
<script src="static/lib/validate/additional-methods.js"></script>

<link href="static/lib/jbox/Metro/jbox.css" rel="stylesheet"/>
<script src="static/lib/jbox/jquery.jBox.js"></script>

<link rel="stylesheet" href="static/kindeditor/themes/default/default.css" />
<script charset="utf-8" src="static/kindeditor/kindeditor.js"></script>
<script charset="utf-8" src="static/kindeditor/kindeditor-lrxin.js"></script>

<script src="static/js/lrxin-form.js"></script>
<script src="static/js/lrxin-list.js"></script>










</body>
</html>
